package com.ygqh.baby.controller.mobile;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.databind.util.JSONPObject;
import com.ygqh.baby.ao.Message;
import com.ygqh.baby.po.YgCategory;
import com.ygqh.baby.service.YgCategoryService;

/**
 * 
 * 分类
 * @author ZhangSai
 *
 */
@Controller
@RequestMapping("/mobile/category")
public class YgCategoryController {
	
	@Autowired
	private YgCategoryService ygCategoryService;
	
	@RequestMapping(value = "findLastLevel")
	@ResponseBody
	public JSONPObject findLastLevel(  @RequestParam(required=true) String callback) {
		List<YgCategory> result =  ygCategoryService.findLastLevel();
		return new JSONPObject(callback, Message.success(result));
	}

	
	
	
}
